From: David J. MacKenzie Date: Thu, 30 Nov 1995 20:05:01 +0000 (+0000) Subject: (tputs): Don't let ospeed overrun the speeds array. X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1^2~5^2~85392 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=c7c5360fe5501317ce839f04a57fc1b14184191a;p=emacs.git (tputs): Don't let ospeed overrun the speeds array. --- diff --git a/src/termcap.c b/src/termcap.c index 595fc425c18..26a12290778 100644 --- a/src/termcap.c +++ b/src/termcap.c @@ -300,8 +300,10 @@ tputs (str, nlines, outfun) #else if (ospeed == 0) speed = tputs_baud_rate; - else + else if (ospeed > 0 && ospeed < (sizeof speeds / sizeof speeds[0])) speed = speeds[ospeed]; + else + speed = 0; #endif if (!str)